package prototype;

/**
 * @author ycc
 * @date 2024/4/2
 */
public class PrototypePatternDemo {
    public static void main(String[] args) {
        Shape circle = new Shape("Circle");
        Shape square = null;
        try {
            square = (Shape) circle.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        square.setType("Square");

        System.out.println(circle.getType());
        System.out.println(square.getType());
    }
}
